package com.qf.controller;

import com.qf.entity.SysUser;
import com.qf.service.MyUserDtailsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class demo1Controller {

    @Autowired
    private MyUserDtailsService myUserDtailsService;

    @RequestMapping("/add")
    public String add(){
        return "demo1";
    }

    @PostMapping("/register")
    public String register(@RequestBody SysUser sysUser) {
        System.out.println(sysUser);
        int i = myUserDtailsService.register(sysUser);
        return "register";
    }

}
